From 3c4ca65395b7df3eb98088d694525ccf1507ae35 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Fri, 25 Nov 2016 07:56:06 -0500 Subject: [PATCH] Don't use case-fold-search in --maybe-replace See https://github.com/syl20bnr/spacemacs/issues/7837#issuecomment-262938480 --- which-key.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/which-key.el b/which-key.el index 50537810a74..b5b671c3833 100644 --- a/which-key.el +++ b/which-key.el @@ -1277,14 +1277,18 @@ local bindings coming first. Within these categories order using (mapconcat #'identity (butlast (split-string str)) " ")) (defun which-key--replacement-test (alist-key key) - (when (and (consp alist-key) - (or (null (car alist-key)) - (string-match-p (car alist-key) (car key))) - (or (null (cdr alist-key)) - (string-match-p (cdr alist-key) (cdr key)))) - (setq which-key--last-replace-key alist-key))) + (let (case-fold-search) + (when (and (consp alist-key) + (or (null (car alist-key)) + (string-match-p (car alist-key) (car key))) + (or (null (cdr alist-key)) + (string-match-p (cdr alist-key) (cdr key)))) + (setq which-key--last-replace-key alist-key)))) (defun which-key--maybe-replace (key-binding) + "Use `which-key--replacement-alist' to maybe replace KEY-BINDING. +KEY-BINDING is a cons cell of the form \(KEY . BINDING\) each of +which are strings. KEY is of the form produced by `key-binding'." (setq which-key--last-replace-key nil) (let* ((mode-alist (assq major-mode which-key-replacement-alist)) (mode-res (when mode-alist -- 2.30.2